import common from '../vendor/common'
import { 
  getRecommendsBuilding
} from '../vendor/api'
const Vue = common.Vue
const mui = common.mui
const buildingList = common.buildingList
var APP = null
try {
  mui.plusReady(function () {
    APP = new Vue({
      el: '#app',
      data: {
        list: []
      },
      components: { buildingList },
      mounted() {
        var self = this
        document.addEventListener('pushData', function(event) {
            var id = event.detail.data.id
            plus.webview.currentWebview().setStyle({titleNView:{titleText:event.detail.data.title}})
            self.list = []
            getRecommendsBuilding(id).then(res => {
              self.list = res.data
            })
        })
      }
    })
  })
} catch (e) {
  console.log('房源推荐页出错啦')
}